<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><title>学生分配</title></head>
<body>
<h2 th:text="'指导教师：' + ${advisor.fullName}"></h2>

<h3>已分配学生</h3>
<table >
  <tr>
    <th>姓名</th><th>Java 成绩</th><th>头像</th><th>操作</th>
  </tr>
  <tr th:each="mentee : ${advisor.menteeList}">
    <td th:text="${mentee.name}"></td>
    <td th:text="${mentee.javaScore}"></td>
    <td>
    <td>
      <img th:if="${mentee.avatarFileName != null}" th:src="@{'/img/' + ${mentee.avatarFileName}}" style="width:100px"/>
      <span th:if="${mentee.avatarFileName == null}">无头像</span>
    </td>
    <td>
      <a th:href="@{/uploadAvatarPage(menteeId=${mentee.id}, advisorId=${advisor.id})}">上传头像</a>
    </td>
    </td>
  </tr>
</table>

<h3>未分配学生</h3>
<table >
  <tr>
    <th>姓名</th><th>Java 成绩</th><th>头像</th><th>操作</th>
  </tr>
  <tr th:each="mentee : ${unassigned}">
    <td th:text="${mentee.name}"></td>
    <td th:text="${mentee.javaScore}"></td>
    <td>
    <td>
      <img th:if="${mentee.avatarFileName != null}" th:src="@{'/img/' + ${mentee.avatarFileName}}" style="width:100px"/>
      <span th:if="${mentee.avatarFileName == null}">无头像</span>
    </td>

    </td>
    <td>
      <a th:href="@{/assignOne(menteeId=${mentee.id}, advisorId=${advisor.id})}">分配</a> |
      <a th:href="@{/uploadAvatarPage(menteeId=${mentee.id}, advisorId=${advisor.id})}">上传头像</a>
    </td>
  </tr>
</table>

<br><a href="/">返回首页</a>
</body>
</html>
